package com.yvan.metrics;

import javax.servlet.http.HttpServletRequest;

/**
 * 过滤器的公共方法
 * Created by luoyifan on 2017/3/1.
 */
public class FilterUtils {

    /**
     * 请求是否需要被拦截
     */
    public static boolean isPass(HttpServletRequest httpRequest) {
        String thisUrl = httpRequest.getRequestURI();
        if (thisUrl.startsWith("/static") ||
                thisUrl.endsWith(".css") || thisUrl.endsWith(".jpg") || thisUrl.endsWith(".jpeg") ||
                thisUrl.endsWith(".html") || thisUrl.endsWith(".js") || thisUrl.endsWith(".png") ||
                thisUrl.endsWith(".gif") || thisUrl.endsWith(".map")) {
            return true;
        }
        return false;
    }

}
